package cn.lingyangwl.agile.misc.short_link.manager;

import cn.lingyangwl.agile.misc.short_link.model.mq.*;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 短链消息发送
 * @author shenguangyang
 */
@Component
public class ShortLinkMqManager {
    @Resource
    private RabbitTemplate rabbitTemplate;

    public void send(SlAccessLogSaveMQ mq) {
        rabbitTemplate.convertAndSend(SlAccessLogSaveMQ.EXCHANGE, SlAccessLogSaveMQ.KEY, mq.toMessage());
    }
}
